Fix UnixUserRecord shell field type from string to path#1260
Open
Peter-The-Great wants to merge 7 commits intofox-it:mainfrom
Open
Fix UnixUserRecord shell field type from string to path#1260Peter-The-Great wants to merge 7 commits intofox-it:mainfrom
Peter-The-Great wants to merge 7 commits intofox-it:mainfrom
Conversation
Made sure to change the field type of shell in UnixUserRecord from string to path. I also added a unit test, with a sanity check to make sure that the operation goes correctly as stated.
Schamper
requested changes
Jul 30, 2025
Remove redundant UnixUserRecord shell type test and added a type assertion test to check if shell variable in user is a valid posix_path.
Schamper
requested changes
Aug 15, 2025
Member
Schamper
left a comment
There was a problem hiding this comment.
Can you fix the failing unit tests?
twiggler
requested changes
Aug 15, 2025
| ("string", "gecos"), | ||
| ("path", "home"), | ||
| ("string", "shell"), | ||
| ("path", "shell"), |
Contributor
There was a problem hiding this comment.
Perhaps the source field should also be a path?
Contributor
Author
|
Sure, I finally have the time. Still working on it. |
Ensure shell field is of type posix_path in UnixUserRecord and update tests accordingly. Apparently, in dissect, the test seemed to fail only on windows, so i made sure that the type is a posix_path, just like the home attribute. If anything needs to change, just let me know in the PR.
Remove breakpoint from user tests
Member
|
@Peter-The-Great do you intend to continue working on this? |
Contributor
Author
Currently no, so if the PR is not necessary, you can close the pr or if someone else is going to implement it, assign it to someone else. |
…ype error fox-it#1260 Ensure home/shell paths use explicit posix_path/windows_path types across OS plugins. Changes: - Path Typing: Enforced explicit posix_path/windows_path types for user home and shell fields across all OS plugins. - Bug Fix: Resolved TypeError in Citrix plugin by normalizing unhashable path objects to strings for deduplication - Consistency: Updated FortiOS and macOS plugins to use semantic path types instead of plain strings. - Tests: Adjusted assertions to match explicit path flavors.
Contributor
Author
|
This seems to have fixed the test errors and a few other issues in the code, not sure if its alright if i kind of force the @staticmethod
def _as_hashable_path_or_str(value: object | None) -> str | None:
if value is None:
return None
if hasattr(value, "as_posix"):
return value.as_posix()
return str(value) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Made sure to change the field type of shell in UnixUserRecord from string to path. I also added a unit test, with a sanity check to make sure that the operation goes correctly as stated.
Closes #900.